<template>
  <div class="box">
    <header class="header">
      <div class="left" @click="back">取消</div>
      <div class="middle">自我介绍</div>
      <div class="right" @click="backdata">保存</div>
    </header>
    <div class="content">
      <textarea class="introduction" placeholder="添加你的自我介绍，提升你的职场人气" id="name"></textarea>
    </div>
  </div>
</template>

<script>
import axios from 'axios'
import QS from 'qs'
export default {
  methods: {
    back () {
      this.$router.go(-1)
      // console.log()
    },
    backdata () {
      this.$router.go(-1)
      var name = document.getElementById('name')
      let data1 = {
        id: 1,
        selfintroduction: name.value
      }
      axios({
        method: 'post',
        url: 'http://10.8.162.38:8080/modifyInfo',
        data: QS.stringify(data1)
      })
        .then(function (response) {
          console.log(response)
        })
        .catch(function (error) {
          console.log(error)
        })
    }
  }
}
</script>

<style lang="scss" scoped>
  .header{
    padding:0 0.1rem;
  }
  .content{
    padding:0.2rem;
    textarea{
      margin-top:0.3rem;
      width:100%;
      height:2rem;
      border:1px solid #ccc;
      letter-spacing:0.02rem;
      padding:0.1rem;
    }
  }
</style>
